/***
    Amrita ITEWS - Copyright (C) 2009 Amrita Vishwa Vidyapeetham, Amritapuri.
                                       (http://www.amrita.edu)
    ***************************************************************************
    This file is part of the Amrita ITEWS distribution.
    Amrita ITEWS is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License (version 2) as published
    by the Free Software Foundation AND MODIFIED BY the Amrita ITEWS exception.
    ***NOTE*** The exception to the GPL is included to allow you to distribute
    a combined work that includes Amrita ITEWS without being obliged to provide
    the source code for proprietary components outside of the Amrita ITEWS
    software. Amrita ITEWS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
    Public License for more details. You should have received a copy of the GNU
    General Public License and the Amrita ITEWS license exception along with
    Amrita ITEWS if not then it can be viewed here:
    http://itews.amrita.ac.in/license.html.


    Documentation, latest information, license and contact details are at:
    http://itews.amrita.ac.in/


    Amrita ITEWS source code can be found at:
    http://code.google.com/p/itews


    The initial code-base of Amrita ITEWS was developed by Amrita Vishwa
    Vidyapeetham as part of the project titled,"Intelligent & Interactive
    Telematics using Emerging Wireless Technologies for Transport Systems
    (ITEWS)" sponsored by Technology Information Forecasting and Assessment
    Council (TIFAC), India.
***/
/*! \file eventq_errno.h
    \brief Header File for EventQ Error Number Definitions.
*/

#ifndef EVENTQ_ERRNO_H_
#define EVENTQ_ERRNO_H_

/*! \brief EventQ Error Number Base.*/
#define EVQ_ERRNO_BASE                      -2000

/*! \brief Eventq Error Number Definition Macro.*/
#define EVQ_ERR(n)                          (EVQ_ERRNO_BASE+(n))

/*! \brief EventQ Config Space Not Found Error.*/
#define EVQ_CFG_SPACE_NOTFOUND_ERR          EVQ_ERR(0)

/*! \brief EventQ Config Space Get String Value Error.*/
#define EVQ_CFG_GET_STR_ERR                 EVQ_ERR(-1)

/*! \brief EventQ Config Space Get Double Value Error.*/
#define EVQ_CFG_GET_DB_ERR                  EVQ_ERR(-2)

/*! \brief EventQ Config Space Variable Name Not Present Error.*/
#define EVQ_CFG_VARNM_NOTPRESENT_ERR        EVQ_ERR(-3)

/*! \brief EventQ Config Space Get Integer Value Error.*/
#define EVQ_CFG_GET_INT_ERR                 EVQ_ERR(-4)

/*! \brief EventQ Entry Table Full Error.*/
#define EVQ_ENTRY_FULL_ERR                  EVQ_ERR(-6)

/*! \brief EventQ Not Present Error.*/
#define EVQ_NOTPRESENT_ERR                  EVQ_ERR(-7)

/*! \brief EventQ String Table Open Error.*/
#define EVQ_STRTBL_OPEN_ERR                 EVQ_ERR(-8)

/*! \brief EventQ String Table Page Size Error.*/
#define EVQ_STRTBL_PAGESZ_ERR               EVQ_ERR(-9)

/*! \brief EventQ String Table MMAP Error.*/
#define EVQ_STRTBL_MMAP_ERR                 EVQ_ERR(-10)

/*! \brief EventQ String Table Put Error.*/
#define EVQ_STRTBL_PUT_ERR                  EVQ_ERR(-11)

/*! \brief EventQ String Table MUNMAP Error.*/
#define EVQ_STRTBL_MUNMAP_ERR               EVQ_ERR(-12)

/*! \brief EventQ Stream Socket Create Error.*/
#define EVQ_ST_SOCK_CREATE_ERR              EVQ_ERR(-13)

/*! \brief EventQ Stream Socket Close Error.*/
#define EVQ_ST_SOCK_CLOSE_ERR               EVQ_ERR(-14)

/*! \brief EventQ Stream Address Already In use Error.*/
#define EVQ_ST_ADDR_INUSE_ERR               EVQ_ERR(-15)

/*! \brief EventQ Stream Socket Already Bound Error.*/
#define EVQ_ST_SOCK_ALREADY_BOUND_ERR       EVQ_ERR(-16)

/*! \brief EventQ Stream Socket Connection Closed by Peer Error.*/
#define EVQ_ST_CONN_PEER_CLOSE_ERR          EVQ_ERR(-17)

/*! \brief EventQ Stream Socket Client Send  Error.*/
#define EVQ_ST_CLIENT_SEND_ERR              EVQ_ERR(-18)

/*! \brief EventQ Stream Socket Already Connected Error.*/
#define EVQ_ST_SOCK_ALREADY_CONNECTED_ERR   EVQ_ERR(-19)

/*! \brief EventQ Stream Socket Connection Establishment Timeout Error.*/
#define EVQ_ST_CONN_EST_TIMEOUT_ERR         EVQ_ERR(-20)

/*! \brief EventQ Stream Socket Listen Error.*/
#define EVQ_ST_LISTEN_ERR                   EVQ_ERR(-21)

/*! \brief EventQ Stream Socket Set SockOpt Error.*/
#define EVQ_ST_SET_SOCKOPT_ERR              EVQ_ERR(-22)

/*! \brief EventQ Stream Unknown Event Error.*/
#define EVQ_ST_UNKNOWN_EVT_ERR              EVQ_ERR(-23)

/*! \brief EventQ Stream Socket Receive Error.*/
#define EVQ_ST_SOCK_RECV_ERR                EVQ_ERR(-24)

/*! \brief EventQ Stream Socket Accept Connection Error.*/
#define EVQ_ST_CONN_ACCEPT_ERR              EVQ_ERR(-25)

/*! \brief EventQ Stream Socket Select Error.*/
#define EVQ_ST_SOCK_SELECT_ERR              EVQ_ERR(-26)

/*! \brief EventQ Stream Socket Select Timeout Error.*/
#define EVQ_ST_SOCK_SELECT_TIMEOUT_ERR      EVQ_ERR(-27)

/*! \brief EventQ Stream Socket Send Error.*/
#define EVQ_ST_SEND_ERR                     EVQ_ERR(-28)

/*! \brief EventQ Stream Socket Bind Error.*/
#define EVQ_ST_BIND_ERR                     EVQ_ERR(-29)

/*! \brief EventQ Stream Socket Connect Error.*/
#define EVQ_ST_CONNECT_ERR                  EVQ_ERR(-30)

/*! \brief EventQ Stream Socket Option Not Supported Error.*/
#define EVQ_ST_SOCKOPT_NOTSUPPORTED_ERR     EVQ_ERR(-31)

/*! \brief EventQ Dgram Socket Create Error.*/
#define EVQ_DG_SOCK_CREATE_ERR              EVQ_ERR(-32)

/*! \brief EventQ Dgram Socket Close Error.*/
#define EVQ_DG_SOCK_CLOSE_ERR               EVQ_ERR(-33)

/*! \brief EventQ Dgram Address In Use Error.*/
#define EVQ_DG_ADDR_INUSE_ERR               EVQ_ERR(-34)

/*! \brief EventQ Dgram Socket Already Bound Error.*/
#define EVQ_DG_SOCK_ALREADY_BOUND_ERR       EVQ_ERR(-35)

/*! \brief EventQ Dgram Socket Send to Error.*/
#define EVQ_DG_SOCK_SENDTO_ERR              EVQ_ERR(-36)

/*! \brief EventQ Dgram Socket Recvfrom Error.*/
#define EVQ_DG_SOCK_RECVFROM_ERR            EVQ_ERR(-37)

/*! \brief EventQ Dgram Unknown Event Error.*/
#define EVQ_DG_UNKNOWN_EVT_ERR              EVQ_ERR(-38)

/*! \brief EventQ Log Invalid Log Level Error.*/
#define EVQ_LOG_INVALID_LOGLEVEL_ERR        EVQ_ERR(-39)

/*! \brief EventQ Log Handle Null Error.*/
#define EVQ_LOG_HANDLE_NULL                 EVQ_ERR(-40)

/*! \brief EventQ Mutex Init Error.*/
#define EVQ_MTX_INIT_ERR                    EVQ_ERR(-41)

/*! \brief EventQ Mutex Lock Error.*/
#define EVQ_MTX_LOCK_ERR                    EVQ_ERR(-42)

/*! \brief EventQ Mutex UnLock Error.*/
#define EVQ_MTX_UNLOCK_ERR                  EVQ_ERR(-43)

/*! \brief EventQ Mutex Destroy Error.*/
#define EVQ_MTX_DESTROY_ERR                 EVQ_ERR(-44)

/*! \brief EventQ Serial Unknown Event Error.*/
#define EVQ_SER_UNKNOWN_EVT_ERR             EVQ_ERR(-45)

/*! \brief EventQ Serial TTY Device File Open Error.*/
#define EVQ_SER_TTY_OPEN_ERR                EVQ_ERR(-46)

/*! \brief EventQ Serial Invalid Operation Mode Error.*/
#define EVQ_SER_INVALID_OPMODE_ERR          EVQ_ERR(-47)

/*! \brief EventQ Serial Invalid Baud Rate Error.*/
#define EVQ_SER_INVALID_BAUDRATE_ERR        EVQ_ERR(-48)

/*! \brief EventQ Serial Invalid Bit Count Error.*/
#define EVQ_SER_INVALID_BITCNT_ERR          EVQ_ERR(-49)

/*! \brief EventQ Serial Invalid Parity Error.*/
#define EVQ_SER_INVALID_PARITY_ERR          EVQ_ERR(-50)

/*! \brief EventQ Serial Termio Set Attribute Error.*/
#define EVQ_SER_TCSETATTR_ERR               EVQ_ERR(-51)

/*! \brief EventQ Serial Termio Flush Error.*/
#define EVQ_SER_TCFLUSH_ERR                 EVQ_ERR(-52)

/*! \brief EventQ Serial Read EOF Error.*/
#define EVQ_SER_READ_EOF_ERR                EVQ_ERR(-53)

/*! \brief EventQ Serial Read Error.*/
#define EVQ_SER_READ_ERR                    EVQ_ERR(-54)

/*! \brief EventQ Serial Write Error.*/
#define EVQ_SER_WRITE_INCOMPLETE_ERR        EVQ_ERR(-55)

/*! \brief EventQ Serial Unknown IOCTL Request Error.*/
#define EVQ_SER_UNKNOWN_IOCTLREQ_ERR        EVQ_ERR(-56)

/*! \brief EventQ Serial TTY Device File Close Error.*/
#define EVQ_SER_TTY_CLOSE_ERR               EVQ_ERR(-57)

/*! \brief EventQ Thread Attribute Init Error.*/
#define EVQ_THR_ATTR_INIT_ERR               EVQ_ERR(-58)

/*! \brief EventQ Thread Attribute Destroy Error.*/
#define EVQ_THR_ATTR_DESTROY_ERR            EVQ_ERR(-59)

/*! \brief EventQ Thread Set Attribute Detach State Error.*/
#define EVQ_THR_SET_DTSTATE_ERR             EVQ_ERR(-60)

/*! \brief EventQ Thread Set Attribute Sched Policy Error.*/
#define EVQ_THR_SET_SCPOLICY_ERR            EVQ_ERR(-61)

/*! \brief EventQ Thread Set Attribute Sched Param Error.*/
#define EVQ_THR_SET_SCPARAM_ERR             EVQ_ERR(-62)

/*! \brief EventQ Thread Set Attribute Inherit Sched Error.*/
#define EVQ_THR_SET_ISCHED_ERR              EVQ_ERR(-63)

/*! \brief EventQ Thread Set Attribute Scope Error.*/
#define EVQ_THR_SET_SCOPE_ERR               EVQ_ERR(-64)

/*! \brief EventQ Thread Create Thread Error.*/
#define EVQ_THR_CREATE_THREAD_ERR           EVQ_ERR(-65)

/*! \brief EventQ Thread Unknown Event Error.*/
#define EVQ_THR_UNKNOWN_EVT_ERR             EVQ_ERR(-66)

/*! \brief EventQ Thread Get Attribute Detach State Error.*/
#define EVQ_THR_GET_DTSTATE_ERR             EVQ_ERR(-67)

/*! \brief EventQ Thread Get Attribute Sched Policy Error.*/
#define EVQ_THR_GET_SCPOLICY_ERR            EVQ_ERR(-68)

/*! \brief EventQ Thread Get Attribute Sched Param Error.*/
#define EVQ_THR_GET_SCPARAM_ERR             EVQ_ERR(-69)

/*! \brief EventQ Thread Get Attribute Inherit Sched Error.*/
#define EVQ_THR_GET_ISCHED_ERR              EVQ_ERR(-70)

/*! \brief EventQ Thread Get Attribute Scope Error.*/
#define EVQ_THR_GET_SCOPE_ERR               EVQ_ERR(-71)


#define EVQ_EPERM_ERR        1  /* Operation not permitted */
#define EVQ_ENOENT_ERR       2  /* No such file or directory */
#define EVQ_ESRCH_ERR        3  /* No such process */
#define EVQ_EINTR_ERR        4  /* Interrupted system call */
#define EVQ_EIO_ERR      5  /* I/O error */
#define EVQ_ENXIO_ERR        6  /* No such device or address */
#define EVQ_E2BIG_ERR        7  /* Arg list too long */
#define EVQ_ENOEXEC_ERR      8  /* Exec format error */
#define EVQ_EBADF_ERR        9  /* Bad file number */
#define EVQ_ECHILD_ERR      10  /* No child processes */
#define EVQ_EAGAIN_ERR      11  /* Try again */
#define EVQ_ENOMEM_ERR      12  /* Out of memory */
#define EVQ_EACCES_ERR      13  /* Permission denied */
#define EVQ_EFAULT_ERR      14  /* Bad address */
#define EVQ_ENOTBLK_ERR     15  /* Block device required */
#define EVQ_EBUSY_ERR       16  /* Device or resource busy */
#define EVQ_EEXIST_ERR      17  /* File exists */
#define EVQ_EXDEV_ERR       18  /* Cross-device link */
#define EVQ_ENODEV_ERR      19  /* No such device */
#define EVQ_ENOTDIR_ERR     20  /* Not a directory */
#define EVQ_EISDIR_ERR      21  /* Is a directory */
#define EVQ_EINVAL_ERR      22  /* Invalid argument */
#define EVQ_ENFILE_ERR      23  /* File table overflow */
#define EVQ_EMFILE_ERR      24  /* Too many open files */
#define EVQ_ENOTTY_ERR      25  /* Not a typewriter */
#define EVQ_ETXTBSY_ERR     26  /* Text file busy */
#define EVQ_EFBIG_ERR       27  /* File too large */
#define EVQ_ENOSPC_ERR      28  /* No space left on device */
#define EVQ_ESPIPE_ERR      29  /* Illegal seek */
#define EVQ_EROFS_ERR       30  /* Read-only file system */
#define EVQ_EMLINK_ERR      31  /* Too many links */
#define EVQ_EPIPE_ERR       32  /* Broken pipe */
#define EVQ_EDOM_ERR        33  /* Math argument out of domain of func */
#define EVQ_ERANGE_ERR      34  /* Math result not representable */
#define EVQ_EDEADLK_ERR     35  /* Resource deadlock would occur */
#define EVQ_ENAMETOOLONG_ERR    36  /* File name too long */
#define EVQ_ENOLCK_ERR      37  /* No record locks available */
#define EVQ_ENOSYS_ERR      38  /* Function not implemented */
#define EVQ_ENOTEMPTY_ERR   39  /* Directory not empty */
#define EVQ_ELOOP_ERR       40  /* Too many symbolic links encountered */
#define EVQ_EWOULDBLOCK EAGAIN_ERR  /* Operation would block */
#define EVQ_ENOMSG_ERR      42  /* No message of desired type */
#define EVQ_EIDRM_ERR       43  /* Identifier removed */
#define EVQ_ECHRNG_ERR      44  /* Channel number out of range */
#define EVQ_EL2NSYNC_ERR    45  /* Level 2 not synchronized */
#define EVQ_EL3HLT_ERR      46  /* Level 3 halted */
#define EVQ_EL3RST_ERR      47  /* Level 3 reset */
#define EVQ_ELNRNG_ERR      48  /* Link number out of range */
#define EVQ_EUNATCH_ERR     49  /* Protocol driver not attached */
#define EVQ_ENOCSI_ERR      50  /* No CSI structure available */
#define EVQ_EL2HLT_ERR      51  /* Level 2 halted */
#define EVQ_EBADE_ERR       52  /* Invalid exchange */
#define EVQ_EBADR_ERR       53  /* Invalid request descriptor */
#define EVQ_EXFULL_ERR      54  /* Exchange full */
#define EVQ_ENOANO_ERR      55  /* No anode */
#define EVQ_EBADRQC_ERR     56  /* Invalid request code */
#define EVQ_EBADSLT_ERR     57  /* Invalid slot */

#define EVQ_EDEADLOCK_ERR   EVQ_EDEADLK_ERR

#define EVQ_EBFONT_ERR      59  /* Bad font file format */
#define EVQ_ENOSTR_ERR      60  /* Device not a stream */
#define EVQ_ENODATA_ERR     61  /* No data available */
#define EVQ_ETIME_ERR       62  /* Timer expired */
#define EVQ_ENOSR_ERR       63  /* Out of streams resources */
#define EVQ_ENONET_ERR      64  /* Machine is not on the network */
#define EVQ_ENOPKG_ERR      65  /* Package not installed */
#define EVQ_EREMOTE_ERR     66  /* Object is remote */
#define EVQ_ENOLINK_ERR     67  /* Link has been severed */
#define EVQ_EADV_ERR        68  /* Advertise error */
#define EVQ_ESRMNT_ERR      69  /* Srmount error */
#define EVQ_ECOMM_ERR       70  /* Communication error on send */
#define EVQ_EPROTO_ERR      71  /* Protocol error */
#define EVQ_EMULTIHOP_ERR   72  /* Multihop attempted */
#define EVQ_EDOTDOT_ERR     73  /* RFS specific error */
#define EVQ_EBADMSG_ERR     74  /* Not a data message */
#define EVQ_EOVERFLOW_ERR   75  /* Value too large for defined data type */
#define EVQ_ENOTUNIQ_ERR    76  /* Name not unique on network */
#define EVQ_EBADFD_ERR      77  /* File descriptor in bad state */
#define EVQ_EREMCHG_ERR     78  /* Remote address changed */
#define EVQ_ELIBACC_ERR     79  /* Can not access a needed shared library */
#define EVQ_ELIBBAD_ERR     80  /* Accessing a corrupted shared library */
#define EVQ_ELIBSCN_ERR     81  /* .lib section in a.out corrupted */
#define EVQ_ELIBMAX_ERR     82  /* Attempting to link in too many shared libraries */
#define EVQ_ELIBEXEC_ERR    83  /* Cannot exec a shared library directly */
#define EVQ_EILSEQ_ERR      84  /* Illegal byte sequence */
#define EVQ_ERESTART_ERR    85  /* Interrupted system call should be restarted */
#define EVQ_ESTRPIPE_ERR    86  /* Streams pipe error */
#define EVQ_EUSERS_ERR      87  /* Too many users */
#define EVQ_ENOTSOCK_ERR    88  /* Socket operation on non-socket */
#define EVQ_EDESTADDRREQ_ERR    89  /* Destination address required */
#define EVQ_EMSGSIZE_ERR    90  /* Message too long */
#define EVQ_EPROTOTYPE_ERR  91  /* Protocol wrong type for socket */
#define EVQ_ENOPROTOOPT_ERR 92  /* Protocol not available */
#define EVQ_EPROTONOSUPPORT_ERR 93  /* Protocol not supported */
#define EVQ_ESOCKTNOSUPPORT_ERR 94  /* Socket type not supported */
#define EVQ_EOPNOTSUPP_ERR  95  /* Operation not supported on transport endpoint */
#define EVQ_EPFNOSUPPORT_ERR    96  /* Protocol family not supported */
#define EVQ_EAFNOSUPPORT_ERR    97  /* Address family not supported by protocol */
#define EVQ_EADDRINUSE_ERR  98  /* Address already in use */
#define EVQ_EADDRNOTAVAIL_ERR   99  /* Cannot assign requested address */
#define EVQ_ENETDOWN_ERR    100 /* Network is down */
#define EVQ_ENETUNREACH_ERR 101 /* Network is unreachable */
#define EVQ_ENETRESET_ERR   102 /* Network dropped connection because of reset */
#define EVQ_ECONNABORTED_ERR    103 /* Software caused connection abort */
#define EVQ_ECONNRESET_ERR  104 /* Connection reset by peer */
#define EVQ_ENOBUFS_ERR     105 /* No buffer space available */
#define EVQ_EISCONN_ERR     106 /* Transport endpoint is already connected */
#define EVQ_ENOTCONN_ERR    107 /* Transport endpoint is not connected */
#define EVQ_ESHUTDOWN_ERR   108 /* Cannot send after transport endpoint shutdown */
#define EVQ_ETOOMANYREFS_ERR    109 /* Too many references: cannot splice */
#define EVQ_ETIMEDOUT_ERR   110 /* Connection timed out */
#define EVQ_ECONNREFUSED_ERR    111 /* Connection refused */
#define EVQ_EHOSTDOWN_ERR   112 /* Host is down */
#define EVQ_EHOSTUNREACH_ERR    113 /* No route to host */
#define EVQ_EALREADY_ERR    114 /* Operation already in progress */
#define EVQ_EINPROGRESS_ERR 115 /* Operation now in progress */
#define EVQ_ESTALE_ERR      116 /* Stale NFS file handle */
#define EVQ_EUCLEAN_ERR     117 /* Structure needs cleaning */
#define EVQ_ENOTNAM_ERR     118 /* Not a XENIX named type file */
#define EVQ_ENAVAIL_ERR     119 /* No XENIX semaphores available */
#define EVQ_EISNAM_ERR      120 /* Is a named type file */
#define EVQ_EREMOTEIO_ERR   121 /* Remote I/O error */
#define EVQ_EDQUOT_ERR      122 /* Quota exceeded */

#define EVQ_ENOMEDIUM_ERR   123 /* No medium found */
#define EVQ_EMEDIUMTYPE_ERR 124 /* Wrong medium type */

#endif /*EVENTQ_ERRNO_H_*/

